<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"
            integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
    <link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">

</head>
<body style="background-color: transparent;">
<div class="container">
    <div class="col-md-10 col-md-offset-1 column">
        <table class="table table-hover table-striped">
            <thead>
            </thead>
            <tbody>
            <%-- 从数据库查询--%>
            <c:forEach var="question" items="${list}">
                <tr>
                    <td> ${question.q_question}
                    </td>
                    <td align="right">
                        <a class="btn btn-success" href="${pageContext.request.contextPath}/question/questionDetail/${question.q_id}">详情</a>
                        &nbsp; | &nbsp;
                        <a class="btn btn-info" href="${pageContext.request.contextPath}/question/toUpdate?id=${question.q_id}">修改</a>
                        &nbsp; | &nbsp;
                        <a class="btn btn-danger"  href="javascript:void(0)" onclick="sc(${question.q_id})">删除</a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
</div>


<script type="text/javascript">

    function sc(id) {
        if(window.confirm("确认删除吗")){
            document.location="${pageContext.request.contextPath}/question/delQuestion?q_id="+id
        }
    }
</script>
</body>
</html>
